import {
  BaseEntity,
  Column,
  Entity,
  PrimaryColumn,
  PrimaryGeneratedColumn,
} from 'typeorm'

// 审批流程表
@Entity({ name: 'task' })
export class Task extends BaseEntity {
  // 自增主键
  @PrimaryGeneratedColumn({ type: 'int', name: 'id' })
  id: number

  // 申请名称
  @PrimaryColumn({
    type: 'varchar',
    name: 'taskName',
  })
  taskName: string

  // 申请类型
  @Column({
    type: 'varchar',
    name: 'taskType',
  })
  taskType: string

  // 申请人
  @Column({
    type: 'varchar',
    name: 'receivePerson',
  })
  receivePerson: string

  // 申请人id
  @Column({
    type: 'int',
    name: 'receivePersonId',
  })
  receivePersonId: number

  // 申请部门
  @Column({
    type: 'varchar',
    name: 'receiveBranch',
  })
  receiveBranch: string

  // 申请部门id
  @Column({
    type: 'int',
    name: 'receiveBranchId',
  })
  receiveBranchId: number

  // 调出/借出部门
  @Column({
    type: 'varchar',
    name: 'receiveOutBranch',
    nullable: true,
  })
  receiveOutBranch: string

  // 调出/借出部门id
  @Column({
    type: 'int',
    name: 'receiveOutBranchId',
    nullable: true,
  })
  receiveOutBranchId: number

  // 申请编号
  @Column({
    type: 'varchar',
    name: 'receiveCode',
  })
  receiveCode: string

  // 申请日期
  @Column({
    type: 'varchar',
    name: 'receiveDate',
  })
  receiveDate: string

  // 申请状态 0 进行中 1 驳回 2 成功
  @Column({
    type: 'varchar',
    name: 'taskStatus',
    nullable: true,
  })
  taskStatus: string

  // 调入/借入申请状态 0 进行中 1 驳回 2 成功
  @Column({
    type: 'varchar',
    name: 'taskInStatus',
    nullable: true,
  })
  taskInStatus: string

  // 调出/借出申请状态 0 进行中 1 驳回 2 成功
  @Column({
    type: 'varchar',
    name: 'taskOutStatus',
    nullable: true,
  })
  taskOutStatus: string

  // 审核人
  @Column({
    type: 'varchar',
    name: 'taskPerson',
    nullable: true,
  })
  taskPerson: string

  // 审核人id
  @Column({
    type: 'int',
    name: 'taskPersonId',
    nullable: true,
  })
  taskPersonId: number

  // 调入/借入 审核人
  @Column({
    type: 'varchar',
    name: 'taskInPerson',
    nullable: true,
  })
  taskInPerson: string

  // 调入/借入 审核人id
  @Column({
    type: 'int',
    name: 'taskInPersonId',
    nullable: true,
  })
  taskInPersonId: number

  // 调出/借出 审核人
  @Column({
    type: 'varchar',
    name: 'taskOutPerson',
    nullable: true,
  })
  taskOutPerson: string

  // 调出/借出 审核人id
  @Column({
    type: 'int',
    name: 'taskOutPersonId',
    nullable: true,
  })
  taskOutPersonId: number

  // 审核日期
  @Column({
    type: 'varchar',
    name: 'taskDate',
    nullable: true,
  })
  taskDate: string

  // 调入审核日期
  @Column({
    type: 'varchar',
    name: 'taskInDate',
    nullable: true,
  })
  taskInDate: string

  // 调出审核日期
  @Column({
    type: 'varchar',
    name: 'taskOutDate',
    nullable: true,
  })
  taskOutDate: string

  // 批复
  @Column({
    type: 'varchar',
    name: 'reason',
    nullable: true,
  })
  reason: string

  // 调出批复
  @Column({
    type: 'varchar',
    name: 'outReason',
    nullable: true,
  })
  outReason: string

  // 调入批复
  @Column({
    type: 'varchar',
    name: 'inReason',
    nullable: true,
  })
  inReason: string

  // 是否删除
  @Column({
    type: 'tinyint',
    name: 'isDelete',
    nullable: true,
  })
  isDelete: boolean
}
